//package com.zmn.oms.admin.controller.work.modify;
//
//import com.zmn.oms.admin.controller.work.WorkBaseController;
//import com.zmn.oms.common.constant.OrderConsts;
//import com.zmn.oms.common.dto.ResultDTO;
//import com.zmn.oms.model.dto.work.modify.amount.ZsChannelAmountDTO;
//import com.zmn.oms.model.entity.work.OrderWork;
//import com.zmn.oms.model.vo.work.OperatePermissionVO;
//import com.zmn.oms.model.vo.work.modify.amount.ZsChannelAmountVO;
//import com.zmn.oms.zmn.business.interfaces.work.ZsOrderWorkOperatePermissionBService;
//import com.zmn.oms.zmn.normal.business.interfaces.work.ZsNormalOrderWorkAmountBService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.servlet.ModelAndView;
//
//import javax.validation.Valid;
//
///**
// * 类描述：改渠道费
// *
// * @author liuying
// * @date 2018/12/10 17:45
// * @modify lujia
// * @deprecated  去掉改渠道费接口
// */
//@Controller
//@RequestMapping("/work/modify")
//@Deprecated
//public class WorkChannelAmountController extends WorkBaseController {
//
//    @Autowired
//    private ZsNormalOrderWorkAmountBService zsNormalOrderWorkAmountBService;
//    @Autowired
//    private ZsOrderWorkOperatePermissionBService orderWorkOperatePermissionBService;
//
//    /**
//     * 改渠道费
//     */
//    @RequestMapping(value = "/channelamount")
//    public ModelAndView updatePrepayAmount(Long orderId, Long workId) {
//        ModelAndView mv = new ModelAndView("work/modify/update_channel_amount.html");
//        OrderWork orderWork = orderWorkService.findOrderWorkByKey(orderId, workId);
//        ZsChannelAmountVO zsChannelAmountVO = new ZsChannelAmountVO();
//        zsChannelAmountVO.setChannelAmount(orderWork.getChannelAmount());
//        // 当有渠道费时，才出现：删除渠道费
//        zsChannelAmountVO.setCanDeleteAmount(orderWork.getChannelAmount() != null && orderWork.getChannelAmount() > 0);
//
//        mv.addObject("orderId", orderId);
//        mv.addObject("workId", workId);
//        mv.addObject("vo", zsChannelAmountVO);
//        return mv;
//    }
//
//    /**
//     * 保存改渠道费
//     *
//     * @param zsChannelAmountDTO 改渠道费
//     * @return
//     */
//    @PostMapping(value = "/save/channelamount")
//    @ResponseBody
//    public ResultDTO saveChannelAmount(@RequestBody @Valid ZsChannelAmountDTO zsChannelAmountDTO) {
//
//        OperatePermissionVO operatePermission = orderWorkOperatePermissionBService.getOperatePermission(zsChannelAmountDTO.getOrderId(), zsChannelAmountDTO.getWorkId(), OrderConsts.ORDER_OP_TYPE_UPDATE_CHANNEL_AMOUNT);
//        if (!operatePermission.getCanOperate()) {
//            return ResultDTO.fail(operatePermission.getMsg());
//        }
//
//        zsNormalOrderWorkAmountBService.saveChannelAmount(zsChannelAmountDTO);
//        return ResultDTO.success();
//    }
//
//}
